package com.augurit.common.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 用户角色关联Entity类
 * 
 */
@Entity
@Table(name = "AC_USER_ROLE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class AcUserRole {

	//属性
	private Long urId;		//主键ID
	private Long userId;	//用户ID
	private Long roleId;	//角色ID
	private String auth;	//是否可分级授权

	
	@Id
    @SequenceGenerator(name="SEQ_AC_USER_ROLE", sequenceName="SEQ_AC_USER_ROLE", allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_AC_USER_ROLE")
	public Long getUrId() {
		return urId;
	}

	public void setUrId(Long urId) {
		this.urId = urId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getRoleId() {
		return roleId;
	}

	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}

	public String getAuth() {
		return auth;
	}

	public void setAuth(String auth) {
		this.auth = auth;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}